package iliasTests;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class AufgIterator
{

    static Collection<Integer> containerFactory(int size)
    {
        Collection<Integer> result = new ArrayList<Integer>();
        for (int i = 0; i < 10; i++)
        {
            result.add(new Integer(i + i));
        }
        return result;
    }

    public static void main(String[] main)
    {
        Collection<Integer> myContainer = AufgIterator.containerFactory(10);
        Iterator<Integer> iter = myContainer.iterator();

        Integer tmp;
        while (iter.hasNext())
        {
            tmp = iter.next();
            if ((tmp.intValue() % 4) == 0)
            {
                System.out.println(iter.next());
            }
            else
            {
                System.out.println(tmp);
            }
        }
    }
}
